<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="root">
    <h2>欢迎来到{{name}}</h2>
    <input type="text" placeholder="按下回车提示输入" @keyup.enter="showInfo">
</div>
<script src="../js/vue.js"></script>
<script>
        Vue.config.productionTip=false//阻止vue启动时产生提示
        new Vue({
             el: "#root",
             data:{
                  name:'',

                },
             methods:{
                showInfo(e){
                    /*if (e.keyCode !==13) return */
                    console.log(e.target.value)
                }
             }
         })
</script>
</body>
</html>